<template>
  <div class>
    <el-tabs :tab-position="tabPosition" type="border-card">
      <el-tab-pane label="抵质押物">
        <el-table :data="MeasuresGuarantee" border style="width: 100%" size="mini">
          <el-table-column align="center" width="30">
            <template slot="header">
              <el-button type="text" size="small" class="el-icon-plus" @click.prevent="addRow1()"></el-button>
            </template>
            <template slot-scope="scope">
              <el-button size="small" type="text" class="el-icon-minus" @click="handle1Delete(scope.$index, scope.row)"></el-button>
            </template>
          </el-table-column>
          <el-table-column type="index" width="50" label="NO.">
          </el-table-column>
          <el-table-column label="类型" align="center" width="120">
            <template slot-scope="scope">
              <el-select v-model="scope.row.type" placeholder="请选择" size="small" >
                <el-option label="房产" value="1"></el-option>
                <el-option label="汽车" value="2"></el-option>
              </el-select>
            </template>
          </el-table-column>
          <el-table-column label="名称" align="center" width="300">
            <template slot-scope="scope">
              <el-input v-model="scope.row.name" type="text"></el-input>
            </template>
          </el-table-column>

          <el-table-column label="关系说明" align="center" width="180">
            <template slot-scope="scope">
              <el-select v-model="scope.row.relation" placeholder="请选择">
                <el-option label="公司所有" value="1"></el-option>
                <el-option label="公司股东所有" value="2"></el-option>
                <el-option label="个人股东所有" value="3"></el-option>
                <el-option label="第三方企业" value="4"></el-option>
                <el-option label="第三方个人" value="5"></el-option>
              </el-select>
            </template>
          </el-table-column>
          <el-table-column label="权属人" align="center" width="180">
            <template slot-scope="scope">
              <el-input v-model="scope.row.ownership"></el-input>
            </template>
          </el-table-column>
          <el-table-column label="反担保方式" align="center" width="180">
            <template slot-scope="scope">
              <el-select v-model="scope.row.guaranteeid" placeholder="请选择">
                <el-option label="抵押" value="1"></el-option>
                <el-option label="质押" value="2"></el-option>
                <el-option label="保证" value="3"></el-option>
                <el-option label="信用" value="4"></el-option>
                <el-option label="保证金" value="5"></el-option>
                <el-option label="保险" value="6"></el-option>
              </el-select>
            </template>
          </el-table-column>
          <el-table-column label="证书编号" align="center" width="180">
            <template slot-scope="scope">
              <el-input v-model="scope.row.certificateNo"></el-input>
            </template>
          </el-table-column>
          <el-table-column label="发票原值(万元)" align="center" width="180">
            <template slot-scope="scope">
              <el-input v-model="scope.row.invoiceAmount"></el-input>
            </template>
          </el-table-column>
          <el-table-column label="评估价值(万元)" align="center" width="180">
            <template slot-scope="scope">
              <el-input v-model="scope.row.appraisalValue"></el-input>
            </template>
          </el-table-column>
          <el-table-column label="折扣率" align="center" width="80">
            <template slot-scope="scope">
              <el-input v-model="scope.row.discountRate"></el-input>
            </template>
          </el-table-column>
          <el-table-column label="备注" align="center">
            <template slot-scope="scope">
              <el-input v-model="scope.row.remark"></el-input>
            </template>
          </el-table-column>
          <el-table-column label="文档数" align="center" width="60">
            <template slot-scope="scope">
              <el-input v-model="scope.row.docAmount"></el-input>
            </template>
          </el-table-column>
          <el-table-column label="操作" align="center" width="170" fixed="right">
            <template slot-scope="scope">
              <el-button type="text" size="small" @click="MeasuresGuaranteeSave(scope.row,scope.$index)" >保存</el-button>
              <el-button type="text" size="small" @click="edit(scope.row)" >编辑</el-button>
              <el-button type="text" size="small" @click="MeasuresGuaranteeFile(scope.row)" >材料</el-button>
            </template>
          </el-table-column>
        </el-table>
      </el-tab-pane>
      <el-tab-pane label="保证企业">
        <el-table :data="MeasuresWarranty" border style="width: 100%" size="mini">
          <el-table-column align="center" width="80">
            <template slot="header">
              <el-button class="el-icon-circle-plus" @click.prevent="addRow2()"></el-button>
            </template>
            <template slot-scope="scope">
              <el-button size="mini" type="danger" class="el-icon-remove" @click="handle2Delete(scope.$index, scope.row)"></el-button>
            </template>
          </el-table-column>
          <el-table-column type="index" width="50" label="NO.">
          </el-table-column>

          <el-table-column label="保证企业编号" align="center">
            <template slot-scope="scope">
              <el-input v-model="scope.row.entNo"></el-input>
            </template>
          </el-table-column>
          <el-table-column label="保证企业名称" align="center">
            <template slot-scope="scope">
              <el-input v-model="scope.row.entName"></el-input>
            </template>
          </el-table-column>

          <el-table-column label="所属区域" align="center">
            <template slot-scope="scope">
              <el-input v-model="scope.row.area"></el-input>
            </template>
          </el-table-column>
          <el-table-column label="关系说明" align="center">
            <template slot-scope="scope">
              <el-select v-model="scope.row.relation">
                <el-option label="上游供应商" value="1"></el-option>
                <el-option label="下游客户" value="2"></el-option>
              </el-select>
            </template>
          </el-table-column>
          <el-table-column label="注册资金(万元)" align="center">
            <template slot-scope="scope">
              <el-input v-model="scope.row.registeredCapital"></el-input>
            </template>
          </el-table-column>

          <el-table-column label="联系人" align="center">
            <template slot-scope="scope">
              <el-input v-model="scope.row.linkman"></el-input>
            </template>
          </el-table-column>
          <el-table-column label="联系电话" align="center">
            <template slot-scope="scope">
              <el-input v-model="scope.row.phone"></el-input>
            </template>
          </el-table-column>
          <el-table-column label="备注" align="center">
            <template slot-scope="scope">
              <el-input v-model="scope.row.remark"></el-input>
            </template>
          </el-table-column>
          <el-table-column label="操作" align="center">
            <template slot-scope="scope">
              <el-button type="text" @click="MeasuresWarrantySelect(scope.$index)" size="small">选择</el-button>
              <el-button type="text" @click="MeasuresWarrantySave(scope.row,scope.$index)" size="small">保存</el-button>
            </template>
          </el-table-column>
        </el-table>
      </el-tab-pane>
      <el-tab-pane label="保证人">
        <el-table :data="tableData3" border style="width: 100%" size="mini">
          <el-table-column align="center" width="80">
            <template slot="header">
              <el-button class="el-icon-circle-plus" @click.prevent="addRow3()"></el-button>
            </template>
            <template slot-scope="scope">
              <el-button size="mini" type="danger" class="el-icon-remove" @click="handle3Delete(scope.$index, scope.row)"></el-button>
            </template>
          </el-table-column>
          <el-table-column type="index" width="50" label="NO.">
          </el-table-column>

          <el-table-column label="保证人编号" align="center">
            <template slot-scope="scope">
              <el-input v-model="scope.row.entNo"></el-input>
            </template>
          </el-table-column>
          <el-table-column label="保证人名称" align="center">
            <template slot-scope="scope">
              <el-input v-model="scope.row.entName"></el-input>
            </template>
          </el-table-column>

          <el-table-column label="证件类型" align="center">
            <template slot-scope="scope">
              <el-input v-model="scope.row.area"></el-input>
            </template>
          </el-table-column>
          <el-table-column label="证件号" align="center">
            <template slot-scope="scope">
              <el-select v-model="scope.row.partnerShip">
                <el-option label="上游供应商" value="1"></el-option>
                <el-option label="下游客户" value="2"></el-option>
              </el-select>
            </template>
          </el-table-column>
          <el-table-column label="关系说明" align="center">
            <template slot-scope="scope">
              <el-input v-model="scope.row.registerEdcapital"></el-input>
            </template>
          </el-table-column>

          <el-table-column label="移动电话" align="center">
            <template slot-scope="scope">
              <el-input v-model="scope.row.peoName"></el-input>
            </template>
          </el-table-column>
          <el-table-column label="送达地址" align="center">
            <template slot-scope="scope">
              <el-input v-model="scope.row.telephone"></el-input>
            </template>
          </el-table-column>
          <el-table-column label="电子邮箱" align="center">
            <template slot-scope="scope">
              <el-input v-model="scope.row.remark"></el-input>
            </template>
          </el-table-column>
          <el-table-column label="备注" align="center">
            <template slot-scope="scope">
              <el-input v-model="scope.row.remark"></el-input>
            </template>
          </el-table-column>
          <el-table-column label="操作" align="center">
            <template slot-scope="scope">
              <el-button type="text" @click="save2(scope.$index)" size="small">选择</el-button>
            </template>
          </el-table-column>
        </el-table>
      </el-tab-pane>
      <el-tab-pane label="其他措施">
        <el-table :data="otherData" border style="width: 100%" size="mini">
          <el-table-column align="center" width="80">
            <template slot="header">
              <el-button class="el-icon-circle-plus" @click.prevent="otherAddRow()"></el-button>
            </template>
            <template slot-scope="scope">
              <el-button size="mini" type="danger" class="el-icon-remove" @click="otherHandleDelete(scope.$index, scope.row)"></el-button>
            </template>
          </el-table-column>
          <el-table-column type="index" width="50" label="NO.">
          </el-table-column>

          <el-table-column label="类型" align="center">
            <template slot-scope="scope">
              <el-select v-model="scope.row.type">
                <el-option label="声明" value="1"></el-option>
                <el-option label="承诺" value="2"></el-option>
                <el-option label="其他" value="3"></el-option>
              </el-select>
            </template>
          </el-table-column>
          <el-table-column label="名称" align="center">
            <template slot-scope="scope">
              <el-input v-model="scope.row.name"></el-input>
            </template>
          </el-table-column>

          <el-table-column label="备注" align="center">
            <template slot-scope="scope">
              <el-input v-model="scope.row.remark"></el-input>
            </template>
          </el-table-column>

          <el-table-column label="操作" align="center">
            <template slot-scope="scope">
              <el-button type="text" @click="otherSave(scope.row,scope.$index)" size="small">保存</el-button>
              <el-button type="text" @click="otherFile(scope.row)" size="small">材料</el-button>
            </template>
          </el-table-column>
        </el-table>
      </el-tab-pane>
    </el-tabs>
    <el-dialog title="企业客户列表" :visible.sync="dialogFormVisible">
      <el-table :data="tableData" border style="width: 100%" size="mini" @row-dblclick="doubleclick">
        <el-table-column type="index" label="序号" align="center" width="50">
        </el-table-column>
        <el-table-column prop="entNo" label="企业编号" align="center" width="260">
        </el-table-column>
        <el-table-column prop="entName" label="企业名称" align="center" width="120">
        </el-table-column>
        <el-table-column prop="area" label="所属区域" align="center" width="120">
        </el-table-column>
        <el-table-column prop="uscCode" align="center" label="统一社会信用代码">
        </el-table-column>
        <el-table-column prop="peoName" align="center" label="法定代表人">
        </el-table-column>
        <el-table-column prop="telephone" align="center" label="联系人电话">
        </el-table-column>
        <el-table-column prop="createUserName" align="center" label="录人员">
        </el-table-column>
      </el-table>
      <el-card style="text-align:right;">
        <el-pagination @size-change="sizeChange" @current-change="currentChange" :current-page="currentPage" :page-sizes="[ 10, 20,30, 40]" :page-size="pageSize" background layout="total, sizes, prev, pager, next" :total="total"></el-pagination>
      </el-card>
    </el-dialog>
    <el-dialog title="个人客户列表" :visible.sync="dialogFormVisible2">
      <el-table :data="personlist" border style="width: 100%" size="mini" @row-dblclick="doubleclick2">
        <el-table-column type="index" label="序号" align="center" width="50">
        </el-table-column>
        <el-table-column prop="entNo" label="客户编号" align="center" width="260">
        </el-table-column>
        <el-table-column prop="entName" label="客户名称" align="center" width="120">
        </el-table-column>
        <el-table-column prop="area" label="证件类型" align="center" width="120">
        </el-table-column>
        <el-table-column prop="uscCode" align="center" label="证件号码">
        </el-table-column>
        <el-table-column prop="peoName" align="center" label="固定电话">
        </el-table-column>
        <el-table-column prop="telephone" align="center" label="移动电话">
        </el-table-column>
      </el-table>
      <el-card style="text-align:right;">
        <el-pagination @size-change="sizeChange2" @current-change="currentChange2" :current-page="currentPage2" :page-sizes="[ 10, 20,30, 40]" :page-size="pageSize2" background layout="total, sizes, prev, pager, next" :total="total2"></el-pagination>
      </el-card>
    </el-dialog>
    <el-dialog title="土地房产清单" :visible.sync="MeasuresHouseShow">
      <el-table :data="MeasuresHouseData" border style="width: 100%" size="mini">
        <el-table-column align="center" width="80">
          <template slot="header">
            <el-button class="el-icon-circle-plus" @click.prevent="MeasuresHouseAddRow()"></el-button>
          </template>
          <template slot-scope="scope">
            <el-button size="mini" type="danger" class="el-icon-remove" @click="MeasuresHouseHandleDelete(scope.$index, scope.row)"></el-button>
          </template>
        </el-table-column>
        <el-table-column type="index" width="50" label="NO.">
        </el-table-column>

        <el-table-column label="抵押物名称" align="center">
          <template slot-scope="scope">
            <el-input v-model="scope.row.measuresName"></el-input>
          </template>
        </el-table-column>
        <el-table-column label="权属关系" align="center">
          <template slot-scope="scope">
            <el-input v-model="scope.row.relation"></el-input>
          </template>
        </el-table-column>

        <el-table-column label="处所" align="center">
          <template slot-scope="scope">
            <el-input v-model="scope.row.location"></el-input>
          </template>
        </el-table-column>
        <el-table-column label="权属证明编号" align="center">
          <template slot-scope="scope">
            <el-input v-model="scope.row.proveCode"></el-input>
          </template>
        </el-table-column>
        <el-table-column label="丘地号" align="center">
          <template slot-scope="scope">
            <el-input v-model="scope.row.qiudiCode"></el-input>
          </template>
        </el-table-column>
        <el-table-column label="面积(平方米)" align="center">
          <template slot-scope="scope">
            <el-input v-model="scope.row.acreage"></el-input>
          </template>
        </el-table-column>
        <el-table-column label="评估单价(元/平方米)" align="center">
          <template slot-scope="scope">
            <el-input v-model="scope.row.price"></el-input>
          </template>
        </el-table-column>
        <el-table-column label="评估总价价(万元/平方米)" align="center">
          <template slot-scope="scope">
            <el-input v-model="scope.row.totalPrice"></el-input>
          </template>
        </el-table-column>
      </el-table>
      <div style="text-align:center;width:100%;margin-top: 20px" >
                <el-button type="primary" @click="MeasuresHousedoSave()">保存</el-button>
       </div>
    </el-dialog>

    <el-dialog title="附件选择" :visible.sync="dialogTableVisible" @close="quXiao">
      <projMateUploadQyComponent :formData.sync="formData" ref="projMateUploadQyComponent"></projMateUploadQyComponent>
    </el-dialog>
  </div>
</template>

<script>
export default {
  components: {
    projMateUploadQyComponent: require("@/pages/biz/proj/proj-mate-upload-qy.vue")
      .default
  },
  props: {
    projectId: String
  },
  data() {
    return {
      dialogTableVisible: false,
      formData: { id: "", projId: "", docAmount: "" },
      tabPosition: "right",
      total: 0,
      pageSize: 10,
      currentPage: 1,
      total2: 0,
      pageSize2: 10,
      currentPage2: 1,
      personlist: [],
      tableData: [],
      MeasuresGuarantee: [],
      MeasuresWarranty: [],
      tableData3: [],
      otherData: [],
      MeasuresHouseData: [],
      dialogFormVisible: false,
      dialogFormVisible2: false,
      MeasuresHouseShow: false,
      form: {
        name: "",
        region: "",
        date1: "",
        date2: "",
        delivery: false,
        type: [],
        resource: "",
        desc: ""
      },
      index: -1,
      index2: -1,
      measuresGuaranteeId: "",
      formLabelWidth: "120px",
      user: {}
    };
  },
  computed: {},
  mounted() {
   
    this.user = JSON.parse(sessionStorage.getItem("user"));
  },
  methods: {
    //保存抵质押物
    MeasuresGuaranteeSave(row, index) {
      this.$api
        .formPost(  "/api/biz/projMeasuresGuarantee/doSave", row)
        .then(res => {
          if (res.retHead.code == "0000000") {
            this.MeasuresGuarantee[index].id = res.retBody;
            this.$message({
              type: "success",
              message: "保存成功"
            });
          } else {
            this.$message({
              type: "error",
              message: res.retHead.message
            });
          }
        });
    },
    //抵质押物上传材料
    MeasuresGuaranteeFile(row) {
      if (row.id == "" || row.id == undefined) {
        this.$message({
          type: "error",
          message: "请先保存，再进行上传"
        });
        return;
      }
      this.formData.id = row.id;
      this.formData.projId = row.projectid;
      if (row.docAmount == undefined) {
        this.formData.docAmount = 0;
      } else {
        this.formData.docAmount = row.docAmount;
      }
      this.dialogTableVisible = true;
    },
    quXiao() {
      //获取文档数
      var num = this.$refs.projMateUploadQyComponent.getUplaodNum();
      if (parseInt(this.formData.docAmount) != parseInt(num)) {
        let param = {
          id: this.formData.id,
          docAmount: num
        };
        this.$api
          .formPost(
              "/api/biz/projMeasuresGuarantee/doModById",
            param
          )
          .then(res => {
            if ((res.retHead.code = "0000000")) {
              this.GetMeasuresGuaranteeList(this.projectId);
              this.$message({
                message: "提交成功！",
                type: "success"
              });
            } else {
              this.$message({
                message: res.retHead.message,
                type: "warning"
              });
            }
          });
      }
    },

    sizeChange(n) {
      this.pageSize = n;
      this.init(this.projectId);
    },
    currentChange(n) {
      this.currentPage = n;
      this.init(this.projectId);
    },

    sizeChange2(n) {
      this.pageSize = n;
      this.init2(this.projectId);
    },
    currentChange2(n) {
      this.currentPage = n;
      this.init2(this.projectId);
    },
    init2(projectId) {},
    
        
    init(projectId) {
      let params = {
        pageNum: this.currentPage,
        pageSize: this.pageSize
      };
      this.$api
        .formPost(  "/api/biz/ent/doGetListByFr", params)
        .then(res => {
          if (res.retHead.code === "0000000") {
            this.tableData = res.retBody.list;
            this.total = res.retBody.total;
          }
        });
        this.GetMeasuresGuaranteeList(projectId);
        this.GetMeasuresWarrantyList(projectId);
        this.GetOtherList(projectId);
      
    },
    //获取反担保措施-抵质押物列表
    GetMeasuresGuaranteeList(projectId){
      let params = {
        pageNum: 1,
        pageSize: 9999,
        projectid:projectId
      };
      this.$api
        .formPost(  "/api/biz/projMeasuresGuarantee/doGetList", params)
        .then(res => {
          if (res.retHead.code === "0000000") {
            this.MeasuresGuarantee = res.retBody.list;
          }
        });
    },
    //获取反担保措施-保证企业列表
    GetMeasuresWarrantyList(projectId){
        let params = {
        pageNum: 1,
        pageSize: 9999,
        projectid:projectId
      };
      this.$api
        .formPost(  "/api/biz/projMeasuresWarranty/doGetList", params)
        .then(res => {
          if (res.retHead.code === "0000000") {
            this.MeasuresWarranty = res.retBody.list;
          }
        });
    },
    edit(row) {
      this.MeasuresHouseShow = true;
      this.measuresGuaranteeId = row.id;
      this.getMeasuresHouseList(row.id);
    },
    //选择保证企业
    MeasuresWarrantySelect(index) {
      this.dialogFormVisible = true;
      this.index = index;
    },
    //保存保证企业
    MeasuresWarrantySave(row, index) {
      this.$api
        .formPost(  "/api/biz/projMeasuresWarranty/doSave", row)
        .then(res => {
          if (res.retHead.code == "0000000") {
            this.MeasuresWarranty[index].id = res.retBody;
            this.$message({
              type: "success",
              message: "保存成功"
            });
          } else {
            this.$message({
              type: "error",
              message: res.retHead.message
            });
          }
        });
    },
    save2(index) {
      this.dialogFormVisible2 = true;
      this.index2 = index;
    },
    doubleclick(val) {
      let data = {
        entNo: val.entNo,
        entName: val.entName,
        area: val.area,
        registeredCapital: val.registerEdcapital,
        linkman: val.peoName,
        phone: val.telephone,
        createUserId: this.user.id,
        createUserName: this.user.realName,
        relation: "1",
        remark: ""
      };
      this.MeasuresWarranty[this.index] = data;
      this.MeasuresWarranty[this.index].projectid = this.projectId;
      this.dialogFormVisible = false;
      this.addRow2();
      this.handle2Delete(this.index, 1);
    },
    doubleclick2(val) {
      this.tableData3[this.index2] = val;
      this.dialogFormVisible = false;
      this.addRow3();
      this.handle3Delete(this.index2, 1);
    },

    // 增加行
    addRow1() {
      var list = {
        id: "",
        projectid: this.projectId
      };
      this.MeasuresGuarantee.unshift(list);
    },
    unshift1(list) {
      this.MeasuresGuarantee.unshift(list);
    },
    addRow2() {
      var list = {
         projectid: this.projectId
      };
      this.MeasuresWarranty.unshift(list);
    },
    addRow3() {
      var list = {
         projectid: this.projectId
      };
      this.tableData3.unshift(list);
    },
    //其他措施增加一行
    otherAddRow() {
      var list = {
         projectid: this.projectId
      };
      this.otherData.unshift(list);
    },
    //增加土地房产一行
    MeasuresHouseAddRow() {
      var list = { 
        projectid:this.projectId,
        measuresGuaranteeId:this.measuresGuaranteeId
      };
      this.MeasuresHouseData.unshift(list);
    },
    handle1Delete(index, row) {
      if(row.id!=''&&row.id!=null){
         this.$api
        .formPost(  "/api/biz/projMeasuresGuarantee/doRmById",row )
        .then(res => {
          if (res.retHead.code == "0000000") {
            this.$message({
              type: "success",
              message: "删除成功"
            });

            this.MeasuresGuarantee.splice(index, 1);
          } else {
            this.$message({
              type: "error",
              message: res.retHead.message
            });
          }
        });
      }else{
          this.MeasuresGuarantee.splice(index, 1);
      }
      
    },
    handle2Delete(index, row) {
      if(row.id!=''&&row.id!=null){
         this.$api
        .formPost(  "/api/biz/projMeasuresWarranty/doRmById",row )
        .then(res => {
          if (res.retHead.code == "0000000") {
            this.$message({
              type: "success",
              message: "删除成功"
            });

            this.MeasuresWarranty.splice(index, 1);
          } else {
            this.$message({
              type: "error",
              message: res.retHead.message
            });
          }
        });
      }else{
        this.MeasuresWarranty.splice(index, 1);
      }
    },
    handle3Delete(index, row) {
      this.tableData3.splice(index, 1);
    },
    //其他措施删除一行
    otherHandleDelete(index, row) {
      if(row.id!=''&&row.id!=null){
         this.$api
        .formPost(  "/api/biz/projMeasuresOther/doRmById",row )
        .then(res => {
          if (res.retHead.code == "0000000") {
            this.$message({
              type: "success",
              message: "删除成功"
            });

           this.otherData.splice(index, 1);
          } else {
            this.$message({
              type: "error",
              message: res.retHead.message
            });
          }
        });
      }else{
        this.otherData.splice(index, 1);
      }
      
    },
    //删除土地房产一行
    MeasuresHouseHandleDelete(index, row) {
      if(row.id!=''&&row.id!=null){
         this.$api
        .formPost(  "/api/biz/projMeasuresHouse/doRmById",row )
        .then(res => {
          if (res.retHead.code == "0000000") {
            this.$message({
              type: "success",
              message: "删除成功"
            });

           this.MeasuresHouseData.splice(index, 1);
          } else {
            this.$message({
              type: "error",
              message: res.retHead.message
            });
          }
        });
      }else{
        this.MeasuresHouseData.splice(index, 1);
      }
      
    },
    //保存土地房产清单
    MeasuresHousedoSave(){
      let params={
        list:this.MeasuresHouseData
      };
      this.$api.post( '/api/biz/projMeasuresHouse/doSaveList',params).then(res => {
              if(res.retHead.code=="0000000"){
                    this.$message({
                        type: 'success',
                        message: "保存成功"
                    });
                }else{
                    this.$message({
                        type: 'error',
                        message: res.retHead.message
                    });
                }
            });
    },
    //获取土地房产清单列表
    getMeasuresHouseList(houseId){
        let params = {
        pageNum: 1,
        pageSize: 9999,
        measuresGuaranteeId:houseId
      };
      this.$api
        .formPost(  "/api/biz/projMeasuresHouse/doGetList", params)
        .then(res => {
          if (res.retHead.code === "0000000") {
            this.MeasuresHouseData = res.retBody.list;
          }
        });
    },
    //抵质押物合计
    getSummaries(param) {
      const { columns, data } = param;
      const sums = [];
      columns.forEach((column, index) => {
        if (index === 0) {
          sums[index] = "总价";
          return;
        }
        const values = data.map(item => Number(item[column.property]));
        if (!values.every(value => isNaN(value))) {
          sums[index] = values.reduce((prev, curr) => {
            const value = Number(curr);
            if (!isNaN(value)) {
              return prev + curr;
            } else {
              return prev;
            }
          }, 0);
          sums[index] += " 元";
        } else {
          sums[index] = "NA/NA";
        }
      });

      return sums;
    },
    //其他措施保存
    otherSave(row,index) {
      this.$api
        .formPost(  "/api/biz/projMeasuresOther/doSave", row)
        .then(res => {
          if (res.retHead.code == "0000000") {
            this.otherData[index].id = res.retBody;
            this.$message({
              type: "success",
              message: "保存成功"
            });
          } else {
            this.$message({
              type: "error",
              message: res.retHead.message
            });
          }
        });
    },
    //获取其他措施列表
    GetOtherList(projectId){
        let params = {
        pageNum: 1,
        pageSize: 9999,
        projectid:projectId
        };
        this.$api
          .formPost(  "/api/biz/projMeasuresOther/doGetList", params)
          .then(res => {
            if (res.retHead.code === "0000000") {
              this.otherData = res.retBody.list;
            }
          });
    },
    //其他措施上传
    otherFile(row) {
  
    }
  },
  created() {}
};
</script>
<style lang='scss' scoped>
</style>